package v2

import (
	controllers "echoapi/app/controller"
	"echoapi/boot"
	"github.com/labstack/echo/v4"
	"net/http"
)

type UserController struct {
	*boot.GormAdapter
	controllers.BaseController
}

func NewUserController() *UserController {
	return &UserController{}
}

func (this *UserController) Index(c echo.Context) error {
	return c.JSON(http.StatusOK, echo.Map{"code": "OK", "msg": "OK", "data": "user/index"})
}

func (this *UserController) UserList(c echo.Context) error {
	return c.JSON(http.StatusOK, echo.Map{"code": "OK", "msg": "OK", "data": "userList"})
}

func (this *UserController) Route(r *echo.Group) {
	r.GET("/user", this.Index)
	r.GET("/userlist", this.UserList)
}
